//
//  MicroDef.h
//  wanzhaoIM
//
//  Created by liuyuantao on 15/4/7.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#ifndef EFengAndETong_MicroDef_h
#define EFengAndETong_MicroDef_h

#import "DDLog.h"
#import "SSKeychain.h"


#define IDKEY @"idkey"

//#define APPTOKEN @"eFeng"
//#define APPTOKEN @"eTong"
#define APPTOKEN @"eFengAndEtong"

#define APPKEY @"appKey"
#define WXAPPID @"wxed4b7921aaa6910f"
#define WXAPP_SECRET @"1a3a6b58445bc873de7a4319deb70007"
#define WXS
#define KUMENGKEY @"5523446dfd98c5be1e0000b5" //友盟 key
#define FACEKEY @"ac4e5df665ee33efa53f8705454bc0d2"
#define FACESECRET @"Qejaz0Lq8pXGwcStvbJb9v3fW1Ck7M1w"
//百度地图Key
#define BMPKEY @"DeIXFlYby86DpN8xnQqXfpXWGr0BIpAW"
#define WZRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
//赋予非空值
#define M_STOREVALUE(a) (M_ISSTRNULL(a)?@"":a)

//判断字符串为空或者长度为0
#define M_ISSTRNULL(a) ((a) == nil || (a).length == 0)
#define REDPACKETNET @"https://tssl.wanzhao.com/redpacket/"
//#define REDPACKETNET @"http://192.168.1.46:8080/redpacket/"

#define UNKNOWNERROR @"未知错误"
#define NETWORKNERROR @"网络异常"
#ifndef USER_DEFAULT

#define USER_DEFAULT [[NSUserDefaults alloc] initWithSuiteName:@"group.cn.com.wanzhao"]
#endif
//缓存根路径
#ifndef USER_DOCUMENT

#define USER_DOCUMENT NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject

#endif

#define StatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
#define HARDWARE_SCREEN_WIDTH   ([UIScreen mainScreen].bounds.size.width)
#define HARDWARE_SCREEN_HEIGHT  ([UIScreen mainScreen].bounds.size.height)
#define IMDIDCOMPOSESHARE @"IMDIDCOMPOSESHARE"
#define IMDIDUPDATEMINEATTENTION @"IMDIDUPDATEMINEATTENTION"
#define WZAttributedActionDidClick @"WZAttributedActionDidClick"
#define WZAttributedLabelDidClick @"WZAttributedLabelDidClick"

#define IsIOS7 ([[[[UIDevice currentDevice] systemVersion] substringToIndex:2] intValue]>=7)
#define IsIOS8 ([[[[UIDevice currentDevice] systemVersion] substringToIndex:2] intValue]>=8)



#ifdef DEBUG

#define WZLog(...) NSLog(__VA_ARGS__)
#define DLog(format, ...) NSLog((@"[文件名:%s]" "[函数名:%s]" "[行号:%d]" format), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
//IM服务器相关以及Etong服务器相关
#define IMIP @"efeng.wanzhao.com"
//#define IMIP @"etest.wanzhao.com"
//#define IMIP @"192.168.1.46"

//Etong
#define SERVERIP @"t.wanzhao.com:8080"
//#define SERVERIP @"192.168.1.20:8080"

#else
#define WZLog(...)
#define DLog(...)
//#define IMIP @"124.193.159.250"
#define IMIP @"efeng.wanzhao.com"
//#define IMIP @"192.168.1.212"

//ETong
#define SERVERIP @"t.wanzhao.com:8080"
//#define SERVERIP @"192.168.1.20:8080"

#endif

#define INSERVERIP @"192.168.30.68:8080"
#define IMPORT 8080

#define OppositeWidthRate(rate) rate * 1.0f
#define OppositeHeightRate(rate) rate * 1.0f


//wifi下更新
#define ISWIFIUPDATE @"ISWIFIUPDATE"

//退出时清空缓存
#define ISClEARMEMORY @"ISClEARMEMORY"

//手机是否认证
#define ISMOBILEAVALable @"isMobileAvalable"

#define DEVICETOKEN @"deviceToken"
//手机的uuid
#define UUID [UIDevice currentDevice].identifierForVendor.UUIDString



#define ISSHOWCHATREDDOPT @"ISSHOWCHATREDDOPT"
#define isContactCompleted @"isContactCompleted"
#define isKeFuCompleted @"isKeFuCompleted"
#define isGroupCompleted @"isGroupCompleted"
#define isOtherContactCompleted @"isOtherContactCompleted"
#define isPresenceCompleted @"isPresenceCompleted"

#define CBEMOTIONSAVEPHONE @"CBEMOTIONSAVEPHONE"

#define FILEMAXSIZE  @"fileMaxSize"
#define ISFORCEQUIT @"ISFORCEQUIT"
#define infoTimeStamp @"infoTimeStamp"
#define is_GuseturePassword @"GuseturePassword"
#define is_ForgetGuesturePassword @"forgetGuesturePassword"
#define GUESTUREPASSWORD @"GUESTUREPASSWORD"
#define SERVER_TIME_SYS @"SERVER_TIME_SYS"
#define SERVER_SHARE_TIME @"SERVER_SHARE_TIME"
#define SERVERVERSION @"server_version"
#define ISFORCEUPDATE @"isforceUpdate"
//聊天内容最大字数限制
#define kMaxTextLength 3000

#define APP_VERSION @"app_version"







#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
#else
static const int ddLogLevel = LOG_LEVEL_INFO;
#endif


#define M_SERVERADDR   @"M_SERVERADDRESS" //服务器地址
#define M_SERVERPORT   @"M_SERVERPORT" //服务器端口
#define M_OPENFIREPORT   @"M_OPENFIREPORT" //openfire服务器端口

#define iPhone5_                    ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[[UIScreen mainScreen] currentMode] size]):NO)
#define iPhoneHeight            (iPhone5_?568.0:480.0)

#define  kCHAvatarSize  [UIImage imageNamed:@"90-90"].size.width
#define INSET_HEIGHT 3.0f//5.0f
#define INSET_WIDTH  5.0f
#define KSEPERATORLINECOLOR RGBCOLOR(0xd4, 0xd4, 0xd4)
#define BUBBLEVIEW_MAX_WIDTH HARDWARE_SCREEN_WIDTH - 150
#define BUBBLEVIEW_PIC_SIZE 85

//for contact
#define Contact_BtnEdge             70
#define Contact_BtnHorizontalSpace  5
#define Contact_BtnVerticalSpace    5
#define Contact_LabelNameHeight     20
#define Contact_MemberWidth         (Contact_BtnEdge+2*Contact_BtnHorizontalSpace)
#define Contact_MemberHeight        (Contact_BtnEdge+Contact_LabelNameHeight+Contact_BtnVerticalSpace)
#define Contact_EdgeSpaceToLeft     (HARDWARE_SCREEN_WIDTH - 4*Contact_MemberWidth)/2
#define Contact_EdgeSpaceToLeft_h   (HARDWARE_SCREEN_WIDTH - 5*Contact_MemberWidth)/2

#define Contact_EdgeSpaceToTop      30
#define Contact_LabelHight          20
#define Contact_LabelWidth          60

#define Contact_ToolViewBtnHSpace   (HARDWARE_SCREEN_WIDTH-1*Contact_ToolViewBtnWidth)/2.
#define Contact_ToolViewBtnVSpace   5
#define Contact_ToolViewBtnWidth    280
typedef NS_ENUM(NSUInteger, selectType) {
    group = 1,
    discuss = 2,
    mineContact = 3,
    organization = 4,
};

typedef enum
{
    TYPE_MAIL_DATA = 0,
    TYPE_ATTACH_DATA
    
}FileType;

typedef enum
{
    IOS3 = 3,
    IOS4 = 4,
    IOS5 = 5
}iOSVersion;

typedef enum {
    ALL_DAY,
    ONLY_NIGHT,
    CLOSE_ALL_TIME
}NO_DISTURB_TIME;

typedef enum {
    MESSAGESETTING_RECEVIEDANDREMIND = 0,
    MESSAGESETTING_RECEVIEDNOTREMIND = 1,
    MESSAGESETTING_ONLYSHOWUNREADCOUNT = 2,
}MESSAGESETTING_TYPE;
typedef enum {
    PINSHOUQI = 0,
    NORMAL,
    PERSON
    
}moneyType;
typedef enum
{
    TimeViewType = 0,
    MyLogViewType,
    OtherLogViewType
}ChatLogViewType;

typedef enum{
    kMessageOK = 0,
    kMessageSending = 2,
    kMessageSendFailed = 4,
    kMessageUserMute = 10,
}MessageSendType;

typedef enum{
    MessageSoundNotPlay = 0,
    MessageSoundPlaying = 2,
    MessageSoundPlayed = 4
}MessageSoundPlayStatus;

typedef enum
{
    kNoticeOK = 0,
    kNoticeSending = 2,
    kNoticeSendFailed = 4,
    kNoticeDeleted    = 8
}NoticeSendType;

enum ProfileStatus
{
    kProfileUpdating,
    kProfileOK,
    kProfileFailed
};


typedef enum {
    CHMessagesViewTimestampPolicyAll = 0,
    CHMessagesViewTimestampPolicyAlternating,
    CHMessagesViewTimestampPolicyEveryThree,
    CHMessagesViewTimestampPolicyEveryFive,
    CHMessagesViewTimestampPolicyCustom
} CHMessagesViewTimestampPolicy;

typedef enum {
    HMEmotionTypeRecent, // 最近
    HMEmotionTypeDefault, // 默认
    HMEmotionTypeEmoji, // Emoji
    HMEmotionTypeLxh // 浪小花
} HMEmotionType;
typedef enum {
    moneyIn = 1,
    moneyOut,
    redPacketOut,
    redOacketIn,
    returnMoney
} moneyInfoKind;

#endif
